/**
 * MeetStartServiceImpl.java
 */
package com.prs.crm.service.meeting.impl;

import java.io.File;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.courser.hibernate.QueryExample;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;

import com.prs.crm.context.AppContext;
import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.meeting.MeetStartDao;
import com.prs.crm.domain.meeting.MeetStart;
import com.prs.crm.domain.meeting.MeetSummary;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.meeting.MeetStartService;

/**
 * @author ZhuDongMei
 * @E-mail:1223984339@qq.com
 * @qq:1223984339
 * @version 创建时间：2011-3-16 上午11:12:28 简单说明
 */

public class MeetStartServiceImpl extends BaseServiceImpl<MeetStart, MeetStartDao> implements
		MeetStartService {
	@Override
	public List<MeetStart> getAllMeetStarts() {
		// TODO Auto-generated method stub
		return this.getDao().getAllMeetStarts();
	}
	@Override
	public MeetStart getMeetStartById(Integer id) {
		// TODO Auto-generated method stub
		return this.getDao().getMeetStartById(id);
	}

	@Override
	public MeetStart getMeetStartByMeetSummary(MeetSummary meetSummary) {
		// TODO Auto-generated method stub
		return this.getDao().getMeetStartByMeetSummary(meetSummary);
	}
	@Override
	public void saveMeetStart(MeetStart meetStart, File file, String fileName) {
		meetStart.setAttach(FileUtil.getInstance().createAttach(file, fileName));
		this.getDao().save(meetStart);
	}
	@Override
	public void saveMeetStarts(MeetStart meetStart, File file, String fileName) {
      Attach cAttach=FileUtil.getInstance().saveFile(file, fileName,"",Constrains.UPLOAD_DIR_MEETSTART);
		
		if(cAttach.getSrc()!=null){
			meetStart.setMeetStart_file(cAttach.getSrc());
		}
		this.getDao().save(meetStart);
	}

	
}
